<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
    <title>Apache Flink: Stratosphere Version 0.4 Migration Guide</title>
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
    <link rel="icon" href="/favicon.ico" type="image/x-icon">

    <!-- Bootstrap -->
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
    <link rel="stylesheet" href="/css/flink.css">
    <link rel="stylesheet" href="/css/syntax.css">

    <!-- Blog RSS feed -->
    <link href="/blog/feed.xml" rel="alternate" type="application/rss+xml" title="Apache Flink Blog: RSS feed" />

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>
  <body>  
    

  <!-- Top navbar. -->
    <nav class="navbar navbar-default navbar-fixed-top">
      <div class="container">
        <!-- The logo. -->
        <div class="navbar-header">
          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <div class="navbar-logo">
            <a href="/"><img alt="Apache Flink" src="/img/navbar-brand-logo.jpg" width="78px" height="40px"></a>
          </div>
        </div><!-- /.navbar-header -->

        <!-- The navigation links. -->
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
          <ul class="nav navbar-nav">
            <!-- Overview -->
            <li><a href="/index.html">Overview</a></li>

            <!-- Quickstart -->
            <li class="dropdown">
              <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Quickstart <span class="caret"></span></a>
              <ul class="dropdown-menu" role="menu">
                <li><a href="http://ci.apache.org/projects/flink/flink-docs-release-0.9/quickstart/setup_quickstart.html">Setup</a></li>
                <li><a href="http://ci.apache.org/projects/flink/flink-docs-release-0.9/quickstart/java_api_quickstart.html">Java API</a></li>
                <li><a href="http://ci.apache.org/projects/flink/flink-docs-release-0.9/quickstart/scala_api_quickstart.html">Scala API</a></li>
                <li><a href="http://ci.apache.org/projects/flink/flink-docs-release-0.9/quickstart/run_example_quickstart.html">Run Step-by-Step Example</a></li>
              </ul>
            </li>

            <!-- Features -->
            <li><a href="/features.html">Features</a></li>

            <!-- Downloads -->
            <li><a href="/downloads.html">Downloads</a></li>

            <!-- Documentation -->
            <li class="dropdown">
              <a href="" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Documentation <span class="caret"></span></a>
              <ul class="dropdown-menu" role="menu">
                <!-- Latest stable release -->
                <li role="presentation" class="dropdown-header"><strong>Latest Release</strong> (Stable)</li>
                <li><a href="http://ci.apache.org/projects/flink/flink-docs-release-0.9">0.9.0 Documentation</a></li>
                <li><a href="http://ci.apache.org/projects/flink/flink-docs-release-0.9/api/java" class="active">0.9.0 Javadocs</a></li>
                <li><a href="http://ci.apache.org/projects/flink/flink-docs-release-0.9/api/scala/index.html" class="active">0.9.0 ScalaDocs</a></li>

                <!-- Snapshot docs -->
                <li class="divider"></li>
                <li role="presentation" class="dropdown-header"><strong>Snapshot</strong> (Development)</li>
                <li><a href="http://ci.apache.org/projects/flink/flink-docs-master">0.10 Documentation</a></li>
                <li><a href="http://ci.apache.org/projects/flink/flink-docs-master/api/java" class="active">0.10 Javadocs</a></li>
                <li><a href="http://ci.apache.org/projects/flink/flink-docs-master/api/scala/index.html" class="active">0.10 ScalaDocs</a></li>

                <!-- Wiki -->
                <li class="divider"></li>
                <li><a href="https://cwiki.apache.org/confluence/display/FLINK/Apache+Flink+Home"><small><span class="glyphicon glyphicon-new-window"></span></small> Wiki</a></li>
              </ul>
            </li>

            <!-- FAQ -->
            <li><a href="/faq.html">FAQ</a></li>
          </ul>

          <ul class="nav navbar-nav navbar-right">
            <!-- Blog -->
            <li class=" active hidden-md hidden-sm"><a href="/blog/">Blog</a></li>

            <li class="dropdown hidden-md hidden-sm">
              <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Community <span class="caret"></span></a>
              <ul class="dropdown-menu" role="menu">
                <!-- Community -->
                <li role="presentation" class="dropdown-header"><strong>Community</strong></li>
                <li><a href="/community.html#mailing-lists">Mailing Lists</a></li>
                <li><a href="/community.html#irc">IRC</a></li>
                <li><a href="/community.html#stack-overflow">Stack Overflow</a></li>
                <li><a href="/community.html#issue-tracker">Issue Tracker</a></li>
                <li><a href="/community.html#source-code">Source Code</a></li>
                <li><a href="/community.html#people">People</a></li>

                <!-- Contribute -->
                <li class="divider"></li>
                <li role="presentation" class="dropdown-header"><strong>Contribute</strong></li>
                <li><a href="/how-to-contribute.html">How to Contribute</a></li>
                <li><a href="/coding-guidelines.html">Coding Guidelines</a></li>
              </ul>
            </li>

            <li class="dropdown hidden-md hidden-sm">
              <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Project <span class="caret"></span></a>
              <ul class="dropdown-menu" role="menu">
                <!-- Project -->
                <li role="presentation" class="dropdown-header"><strong>Project</strong></li>
                <li><a href="/material.html">Material</a></li>
                <li><a href="https://twitter.com/apacheflink"><small><span class="glyphicon glyphicon-new-window"></span></small> Twitter</a></li>
                <li><a href="https://github.com/apache/flink"><small><span class="glyphicon glyphicon-new-window"></span></small> GitHub</a></li>
                <li><a href="https://cwiki.apache.org/confluence/display/FLINK/Apache+Flink+Home"><small><span class="glyphicon glyphicon-new-window"></span></small> Wiki</a></li>
              </ul>
            </li>
          </ul>
        </div><!-- /.navbar-collapse -->
      </div><!-- /.container -->
    </nav>


    <!-- Main content. -->
    <div class="container">
      

<div class="row">
  <div class="col-sm-8 col-sm-offset-2">
    <div class="row">
      <h1>Stratosphere Version 0.4 Migration Guide</h1>

      <article>
        <p>12 Jan 2014</p>

<p>This guide is intended to help users of previous Stratosphere versions to migrate their programs to the new API of v0.4.</p>

<p>Version <code>0.4-rc1</code>, <code>0.4</code> and all newer versions have the new API. If you want to have the most recent version before the code change, please set the version to <code>0.4-alpha.3-SNAPSHOT</code>. (Note that the <code>0.4-alpha</code> versions are only available in the snapshot repository).</p>

<h4 id="maven-dependencies">Maven Dependencies</h4>
<p>Since we also reorganized the Maven project structure, existing programs need to update the Maven dependencies to <code>stratosphere-java</code> (and <code>stratosphere-clients</code>, for examples and executors).</p>

<p>The typical set of Maven dependencies for Stratosphere Java programs is:</p>

<div class="highlight"><pre><code class="language-diff">       &lt;groupId&gt;eu.stratosphere&lt;/groupId&gt;
<span class="gd">-      &lt;artifactId&gt;pact-common&lt;/artifactId&gt;</span>
<span class="gd">-      &lt;version&gt;0.4-SNAPSHOT&lt;/version&gt;</span>
<span class="gi">+      &lt;artifactId&gt;stratosphere-java&lt;/artifactId&gt;</span>
<span class="gi">+      &lt;version&gt;0.4&lt;/version&gt;</span>

<span class="gd">-      &lt;artifactId&gt;pact-clients&lt;/artifactId&gt;</span>
<span class="gd">-      &lt;version&gt;0.4-SNAPSHOT&lt;/version&gt;</span>
<span class="gi">+      &lt;artifactId&gt;stratosphere-clients&lt;/artifactId&gt;</span>
<span class="gi">+      &lt;version&gt;0.4&lt;/version&gt;</span></code></pre></div>

<h4 id="renamed-classes">Renamed classes</h4>

<p>We renamed many of the most commonly used classes to make their names more intuitive:</p>

<table class="table table-striped">
  <thead>
  	<tr>
  	<th>Old Name (before <code>0.4</code>)</th>
  	<th>New Name (<code>0.4</code> and after)</th>
  </tr>
  </thead>
 	<tbody>
	  <tr>
	  	<td>Contract</td>
	  	<td>Operator</td>
	  </tr>
	  <tr>
	  	<td>MatchContract</td>
	  	<td>JoinOperator</td>
	  </tr>

	  	  <tr>
	  	<td>[Map, Reduce, ...]Stub</td>
	  	<td>[Map, Reduce, ...]Function</td>
	  </tr>
	  	  <tr>
	  	<td>MatchStub</td>
	  	<td>JoinFunction</td>
	  </tr>
	  	  <tr>
	  	<td>Pact[Integer, Double, ...]</td>
	  	<td>IntValue, DoubleValue, ...</td>
	  </tr>	  
	  <tr>
	  	<td>PactRecord</td>
	  	<td>Record</td>
	  </tr>
	  	  <tr>
	  	<td>PlanAssembler</td>
	  	<td>Program</td>
	  </tr>
	  	  <tr>
	  	<td>PlanAssemblerDescription</td>
	  	<td>ProgramDescription</td>
	  </tr>
	  	  <tr>
	  	<td>RecordOutputFormat</td>
	  	<td>CsvOutputFormat</td>
	  </tr>
	</tbody>
</table>

<p>Package names have been adapted as well.
For a complete overview of the renamings, have a look at <a href="https://github.com/stratosphere/stratosphere/issues/257">issue #257 on GitHub</a>.</p>

<p>We suggest for Eclipse user adjust the programs as follows: Delete all old Stratosphere imports, then rename the the classes (<code>PactRecord</code> to <code>Record</code> and so on). Finally, use the “Organize Imports” function (<code>CTRL+SHIFT+O</code>) to choose the right imports. The names should be unique so always pick the classes that are in the <code>eu.stratosphere</code> package.</p>

<p>Please contact us in the comments below, on the mailing list or on GitHub if you have any issues migrating to the latest Stratosphere release.</p>

      </article>
    </div>

    <div class="row">
      <div id="disqus_thread"></div>
      <script type="text/javascript">
        /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
        var disqus_shortname = 'stratosphere-eu'; // required: replace example with your forum shortname

        /* * * DON'T EDIT BELOW THIS LINE * * */
        (function() {
            var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
            dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
             (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
        })();
      </script>
    </div>
  </div>
</div>

      <hr />
      <div class="footer text-center">
        <p>Copyright © 2014-2015 <a href="http://apache.org">The Apache Software Foundation</a>. All Rights Reserved.</p>
        <p>Apache Flink, Apache, and the Apache feather logo are trademarks of The Apache Software Foundation.</p>
        <p><a href="/privacy-policy.html">Privacy Policy</a> &middot; <a href="/blog/feed.xml">RSS feed</a></p>
      </div>

    </div><!-- /.container -->

    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
    <script src="/js/codetabs.js"></script>

    <!-- Google Analytics -->
    <script>
      (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
      (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
      m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
      })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

      ga('create', 'UA-52545728-1', 'auto');
      ga('send', 'pageview');
    </script>
  </body>
</html>
